import Vue from 'vue'
import Router from 'vue-router'

import ChannelModules from './modules/channel'
import SceneModules from './modules/scene'
import RulesModules from './modules/rule'
import SystemModules from './modules/system'
import ResourcesModules from './modules/resources'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      hidden: true,
      redirect: '/channel/channel/sceneManage'
    },
    {
      path: '/',
      hidden: true,
      name: '',
      component: resolve => (require(['../frame/frame.vue'], resolve)),
      children: [
        {
          path: '/main',
          name: '标签管理系统',
          hidden: true,
          component: resolve => (require(['../pages/main.vue'], resolve))
        },
        {
          path: '/noauth',
          hidden: true,
          name: '',
          component: resolve => (require(['../pages/noAuth.vue'], resolve))
        }
      ]
    },
    {
      path: '/login',
      hidden: true,
      name: '',
      component: resolve => (require(['../pages/login.vue'], resolve))
    },
    ...ChannelModules,
    ...SceneModules,
    ...RulesModules,
    ...ResourcesModules,
    ...SystemModules,
  ]
})
